package emulator.unittest.hardware.nmos6502.commands;


import static org.junit.Assert.assertEquals;

import org.junit.Test;

import emulator.EmulatorException;
import emulator.hardware.nmos6502.Cpu6502;
import emulator.hardware.nmos6502.Flags6502;
import emulator.hardware.nmos6502.commands.CLI;
import emulator.unittest.hardware.nmos6502.MockOperand;

public class CLITest {

	@Test
	public void testClearFromFalse() throws EmulatorException {
		Cpu6502 cpu = new Cpu6502();
		cpu.setFlags(new Flags6502(0));
		CLI cli = new CLI();
		cli.execute(cpu, new MockOperand(0));
		assertEquals(false, cpu.getFlags().getInterrupt());
	}

	@Test
	public void testClearFromTrue() throws EmulatorException {
		Cpu6502 cpu = new Cpu6502();
		cpu.setFlags(new Flags6502(Flags6502.FLAG_INTERRUPT));
		CLI cli = new CLI();
		cli.execute(cpu, new MockOperand(0));
		assertEquals(false, cpu.getFlags().getInterrupt());
	}

}
